<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- 怎样用一百块买一百只鸡，已知公鸡5块一只，母鸡3块一只，小鸡一块钱3只 -->
    <script>
        for (var gong = 0; gong <= 20; gong++) {
            for (var mu = 0; mu <= 33; mu++) {
                for (var small = 0; small <= 300; small++) {
                    if (gong + mu + small == 100 && 5 * gong + 3 * mu + 1 / 3 * small  == 100) {
                        document.write('公鸡:' + gong + ',母鸡:' + mu + ',小鸡:' + small);
                        document.write('<br>');
                    }
                }
            }
        }
        
    </script>
</body>
</html>